﻿using SqlSugar;

namespace Magic.Core;

/// <summary>
/// 管理员表
///</summary>
[SugarTable("sys_user")]
public class SysUser
{
    /// <summary>
    /// ID 
    ///</summary>
    [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
    public int Id { get; set; }
    /// <summary>
    /// 用户名 
    /// 默认值: 
    ///</summary>
    [SugarColumn(ColumnName = "username")]
    public string Username { get; set; }
    /// <summary>
    /// 昵称 
    /// 默认值: 
    ///</summary>
    [SugarColumn(ColumnName = "nickname")]
    public string Nickname { get; set; }
    /// <summary>
    /// 头像 
    /// 默认值: 
    ///</summary>
    [SugarColumn(ColumnName = "avatar")]
    public string Avatar { get; set; }
    /// <summary>
    /// 邮箱 
    /// 默认值: 
    ///</summary>
    [SugarColumn(ColumnName = "email")]
    public string Email { get; set; }
    /// <summary>
    /// 手机 
    /// 默认值: 
    ///</summary>
    [SugarColumn(ColumnName = "mobile")]
    public string Mobile { get; set; }
    /// <summary>
    /// 登录失败次数 
    /// 默认值: 0
    ///</summary>
    [SugarColumn(ColumnName = "loginfailure")]
    public byte Loginfailure { get; set; }
    /// <summary>
    /// 登录时间 
    ///</summary>
    [SugarColumn(ColumnName = "lastlogintime")]
    public long Lastlogintime { get; set; }
    /// <summary>
    /// 登录IP 
    ///</summary>
    [SugarColumn(ColumnName = "lastloginip")]
    public string Lastloginip { get; set; }
    /// <summary>
    /// 密码 
    /// 默认值: 
    ///</summary>
    [SugarColumn(ColumnName = "password")]
    public string Password { get; set; }
    /// <summary>
    /// 密码盐 
    /// 默认值: 
    ///</summary>
    [SugarColumn(ColumnName = "salt")]
    public string Salt { get; set; }
    /// <summary>
    /// 签名 
    /// 默认值: 
    ///</summary>
    [SugarColumn(ColumnName = "motto")]
    public string Motto { get; set; }
    /// <summary>
    /// 创建时间 
    ///</summary>
    [SugarColumn(ColumnName = "createtime")]
    public long Createtime { get; set; }
    /// <summary>
    /// 更新时间 
    ///</summary>
    [SugarColumn(ColumnName = "updatetime")]
    public long Updatetime { get; set; }
    /// <summary>
    /// 状态:0=禁用,1=启用 
    /// 默认值: 1
    ///</summary>
    [SugarColumn(ColumnName = "status")]
    public StatusEnum Status { get; set; }
    //导航查询
    [Navigate(NavigateType.OneToMany,nameof(SysUserRole.Uid))]
    public List<SysUserRole> AdminGroupAccesses { get; set; }
}
